import request from '@/utils/request'
import Qs from 'qs'

export function queryShopOne(query) {
  return request({
    method: 'get',
    params: {
      _gp: 'admin.shopOne',
      _mt: 'queryShopOneNew',
      ...query
    }
  })
}

export function queryShopOneByPerson(query) {
  return request({
    method: 'get',
    params: {
      _gp: 'admin.shopOne',
      _mt: 'queryShopOneNewByPerson',
      ...query
    }
  })
}

export function deleteShopOne(id) {
  return request({
    method: 'post',
    params: {
      _gp: 'admin.shopOne',
      _mt: 'deleteShopOne',
      id: id
    }
  })
}

export function createShopOne(spuId) {
  return request({
    method: 'post',
    data: Qs.stringify({
      _gp: 'admin.shopOne',
      _mt: 'addShopOne',
      spuId: spuId
    })
  })
}
